/* 
字符串相关扩展
    includes() 判断字符串中是否包含指定的字串（有的话返回true，否则返回false）
               参数一：匹配的字串；参数二：从第几个开始匹配
    startsWith()  判断字符串是否以特定的字串开始
    endsWith()  判断字符串是否以特定的字串结束

    模板字符串

*/
let str = 'heoll world'
    // console.log(str.includes("heoll"));
    // console.log(str.includes('heoll', 7));

// ---------------------------
let url = 'admin/index.php';
console.log(url.startsWith('aadmin'));

console.log(url.endsWith('php'));
// ------------------
var obj = {
    name: '小潘',
    age: '20',
    love: '吃吃'
}
let fun = function(info) {
    return info;
}
let tpl = `
    <div>
        <span>${obj.name}</span>
        <span>${obj.age}</span>
        <span>${obj.love}</span>
        <span>${1+2}</span>
        <span>${fun('我爱你潘潘')}</span>
    </div>
`;
console.log(tpl);